from django.http import HttpResponse, JsonResponse
from django.shortcuts import render

# Create your views here.
from django.views import View


class FuxiView(View):
    def post(self, request, number):
        print('路径参数解析:', number)
        print('查询参数解析:', request.GET)
        print('表单参数解析:', request.POST)
        print('请求头解析:', request.META.get('HTTP_DATE'))

        # return HttpResponse(
        #     content='有请求体的 一次最多发4种参数!',
        #     content_type="text/html; charset=utf-8;",  # MIME
        #     status=200
        # )

        # response = HttpResponse()
        # response.content = 'Hello world!'
        # response.status_code = 305
        # return response
        data_dict = [
            {
                'k': 'v'
            }
        ]
        return JsonResponse(data_dict, safe=False)
